﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Collections;
using System.Collections.Generic;
namespace YiDingCanWp7
{
    public class ShopDTO : IEquatable<ShopDTO>
    {
        public int ShopId { get; set; }
        public string Title { get; set; }
        public double Lat { get; set; }
        public double Lng { get; set; }
        public Guid Id { get; set; }
        public string WorkTime { get; set; }
        public string Phone { get; set; }
        public string Logo { get; set; }
        public decimal UpSendPrice { get; set; }
        public string DeliverRegion { get; set; }
        public string DeliverArea { get; set; }
        public string DeleverSpeed { get; set; }
        public string Address { get; set; }
        public int Qos { get; set; }
        public int Speed { get; set; }
        public int Taste { get; set; }
        private int _avg = 0;
        public int Avg { get {
            if (_avg==0)
            {
                _avg=(Qos + Speed + Taste) / 3;
            }
            return _avg;
        } }
        private string _Scores = string.Empty;
        public string Scores
        {
            get
            {
            if (string.IsNullOrEmpty(_Scores))
            {
                _Scores = string.Format("速度：{0} 服务：{1} 口味:{2}",Speed,Qos,Taste);
            }
            return _Scores;
        } 
        }

        public bool Equals(ShopDTO other)
        {
            if (other.Id==this.Id)
            {
                return true;
            }
            else
            {
                return false;
            }
        }
    }
    public class Shops {
        public List<ShopDTO> items { get; set; }
        public int total { get; set; }
    }
}
